package practica2;

import impl.sort.AbstractSorter;
import impl.sort.SelectionSorter;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tomi
 * Date: 30/08/2011
 * Time: 15:10:05
 * To change this template use File | Settings | File Templates.
 */
public class NCTest {
    public static void main(String[]ars){
        NCDataSetGenerator nc = new NCDataSetGenerator();
        List<NombreCompleto> listA = nc.createAscending(0);
        List<NombreCompleto> listB = nc.createDescending(0);
        List<NombreCompleto> listC = nc.createRandom(5);
        AbstractSorter as = new SelectionSorter();
        System.out.println("A");
        for(int i=0; i<listA.size(); i++){
            System.out.println(listA.get(i).getApellido()+", "+listA.get(i).getNombre());
        }
        System.out.println("B");
        for(int i=0; i<listB.size(); i++){
            System.out.println(listB.get(i).getApellido()+", "+listB.get(i).getNombre());
        }
        System.out.println("C");
        for(int i=0; i<listC.size(); i++){
            System.out.println(listC.get(i).getApellido()+", "+listC.get(i).getNombre());
        }
        as.sort(nc.getComparator(), listA);
        as.sort(nc.getComparator(), listB);
        as.sort(nc.getComparator(), listC);
        System.out.println("A Ordenada");
        for(int i=0; i<listA.size(); i++){
            System.out.println(listA.get(i).getApellido()+", "+listA.get(i).getNombre());
        }
        System.out.println("B Ordenada");
        for(int i=0; i<listB.size(); i++){
            System.out.println(listB.get(i).getApellido()+", "+listB.get(i).getNombre());
        }
        System.out.println("C Ordenada");
        for(int i=0; i<listC.size(); i++){
            System.out.println(listC.get(i).getApellido()+", "+listC.get(i).getNombre());
        }
    }
}